<%--
  Created by IntelliJ IDEA.
  author: Jsonor
  date: 2018/4/19 14:28
  description: Description
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"
      integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<HTML>
<head>
  <title>查询书籍结果</title>
</head>


<body>
<h1 align="center">${count}</h1>
<table align="center" style="background-color: aqua" class="table-bordered">
  <tr>
    <td align="center" width="5px">
      书籍序列号
    </td>
    <td align="center" width="30px">
      书籍名称
    </td>
    <td align="center" width="20px">
      作者
    </td>
    <td align="center" width="30px">
      图片
    </td>
    <td align="center" width="50px">
      书籍简介
    </td>
    <td align="center" width="20px">
      书籍归类
    </td>
    <td align="center" width="10px">
      书籍价格
    </td>
    <td align="center" width="20px">
      出版社
    </td>
    <td align="center" width="30px">
      发布日期
    </td>
    <td align="center" width="10px">
      是否热门
    </td>
  </tr>
  <c:forEach var="p" items="${list}" varStatus="status">
  <tr onmouseover="this.style.backgroundColor = 'white'"
      onmouseout="this.style.backgroundColor = '#F5FAFE';">
    <td style="CURSOR: hand; HEIGHT: 22px" align="center"
        width="5px">
        ${status.count}
    </td>
    <td style="CURSOR: hand; HEIGHT: 22px" align="center"
        width="10px">
        ${p.bname}
    </td>
    <td style="CURSOR: hand; HEIGHT: 22px" align="center"
        width="20px">
        ${p.auto}
    </td>
    <td style="CURSOR: hand; HEIGHT: 22px" align="center"
        width="10px">
      <img src="${pageContext.request.contextPath}/web-image/book-image/${p.image}">
    </td>
    <td style="CURSOR: hand; HEIGHT: 22px" align="center"
        width="20px">
        ${p.desc}
    </td>
    <td style="CURSOR: hand; HEIGHT: 22px" align="center"
        width="20px">
        ${p.category}
    </td>
    <td style="CURSOR: hand; HEIGHT: 22px" align="center"
        width="20px">
        ${p.price}
    </td>
    <td style="CURSOR: hand; HEIGHT: 22px" align="center"
        width="20px">
        ${p.publishingHouse}
    </td>
    <td style="CURSOR: hand; HEIGHT: 22px" align="center"
        width="20px">
        ${p["delivery_time"]}
    </td>
    <td style="CURSOR: hand; HEIGHT: 22px" align="center"
        width="20px">
      <c:choose>
        <c:when test="${p['is_Hot']==1}">1</c:when>
        <c:otherwise>0</c:otherwise>
      </c:choose>
    </td>
    </c:forEach>
</table>

<table>
  <div align="center" style="color: white">
    <span style="color: red">第${page. pageNum}页/共${page.pages}页</span>
    <br>
    <c:choose>
      <c:when test="${page.pageNum eq page.pages}">

      </c:when>
      <c:otherwise>
        <a style="color:red;text-decoration: none" href="${pageContext.request.contextPath}/app/book/searchBookByName?name=${name}&start=1">首页</a>
        <c:if test="${page.hasPreviousPage}">
          <a style="color: red;text-decoration: none"  href="${pageContext.request.contextPath}/app/book/searchBookByName?name=${name}&start=${page.prePage}">上一页</a>
        </c:if>
        <c:forEach var="num" begin="1" end="${page.pages}">
          <c:choose>
            <c:when test="${num==page.pageNum}">
              <span style="color:red;">${num}</span>
            </c:when>
            <c:otherwise>
              <a style="color:red;text-decoration: none" href="${pageContext.request.contextPath}/app/book/searchBookByName?name=${name}&start=${num}">[${num}]</a>
            </c:otherwise>
          </c:choose>
        </c:forEach>
        <c:if test="${page.hasNextPage}">
          <a style="color:red;text-decoration: none" href="${pageContext.request.contextPath}/app/book/searchBookByName?name=${name}&start=${page.nextPage}">下一页</a>
        </c:if>
        <a style="color: red;text-decoration: none" href="${pageContext.request.contextPath}/app/book/searchBookByName?name=${name}&start=${page.pages}">尾页</a>
      </c:otherwise>
    </c:choose>

  </div>
</table>
</body>


</HTML>

